﻿<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:s="http://www.codeplex.com/MSSqlSchemaDoc">

  <xsl:import href="DataType.xsl" />
  <xsl:param name="DocumentationFile"/>
  
  <xsl:template match="s:ProcedureParameter">

    <xsl:variable name="ParamName" select="@Name"/>

    <tr class="center">
      <td class="tablePrimaryColumn">
        <xsl:value-of select="$ParamName"/>
      </td>
      <td>
        <xsl:apply-templates select="s:DataType" />
      </td>
      <td>
        <xsl:value-of select="s:IsOutputParameter"/>
      </td>
      <td>
        <xsl:value-of select="s:IsCursorReference"/>
      </td>
      <td>
        <xsl:value-of select="s:HasDefaultValue"/>
      </td>
      <td>
        <xsl:value-of select="s:IsCompleteXmlDocument"/>
      </td>
      <td>
        <xsl:value-of select="s:XmlCollectionId"/>
      </td>
    </tr>
    <tr>
      <td colspan="7" class="documentation center">
        <pre>
          <xsl:value-of select="document($DocumentationFile)/s:StoredProcedureDocumentation/s:Parameters/s:ParameterDocumentation[@Name=$ParamName]/s:Documentation"/>
          <xsl:value-of select="document($DocumentationFile)/s:UserDefinedFunctionDocumentation/s:Parameters/s:ParameterDocumentation[@Name=$ParamName]/s:Documentation"/>
        </pre>
      </td>
    </tr>
  
  </xsl:template>
</xsl:stylesheet>